<?php
include_once 'app/modul/db/userConnector.php';

class ModulProgress extends GetData{

	public $daten     = null;
	public $System     = null;
	public $ActivUser  = 0;
	public $expire_time      = 0;	

	public function __construct($match){
		$this->daten = $match;
	}

	public function getWort(RainTPL $design){
	    $this->design = $design;  
        parent::GetData();
        
	    $Modul = new Db_Modul();  

	    if(isset($this->daten["Modul_ID"])){
            if($Modul->aktivModul($this->ActivUser->id,$this->daten["Modul_ID"])){      
			    $this->design->Modul_nr = $this->daten["Modul_ID"];     
			    $this->design->user_id = $this->ActivUser->id;
			              
			    $pageexplorer = new Db_user_page_explorer();
			    
			    $modulclass = $Modul->getModulSetting($this->daten["Modul_ID"]);
			    
			    include_once 'app/modul/'.$modulclass->Controller.'.php';
			    
			    $modul = new $modulclass->Controller($this->design);

			    $modul->Progress();
            }else{                              
			    HTTP::redirect ( BASE_URL . '/modul/error/1' );
            }
        }
        else
        {
        	HTTP::redirect ( BASE_URL . '/modul/error/2' );
        }
	}
}
?>